﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using taigu.WeChat;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;

namespace taigu
{
    public class db_taskService: ApplicationService,Idb_taskService
    {
        private readonly IRepository<db_task,int> _db_Tasks;

        public db_taskService(IRepository<db_task, int> db_Tasks)
        {
            _db_Tasks = db_Tasks;
        }
        /// <summary>
        /// 体温添加
        /// </summary>
        /// <param name="dbtask"></param>
        /// <returns></returns>
        [HttpPost,Route("/wechat/db_taskAdd")]
        [AllowAnonymous]
        public async Task<ResData<string>> db_taskAdd(Createdb_taskDTO dbtask)
        {
            db_task dbTask = ObjectMapper.Map<Createdb_taskDTO,db_task>(dbtask);
            await _db_Tasks.InsertAsync(dbTask);
            return new ResData<string>() { Status = ResStatus.成功, Msg = "sucess", Info = "" };
        }
    }
}
